//package com.wangnaiqi.pulsar.service;
//
//import org.apache.pulsar.client.api.Consumer;
//import org.apache.pulsar.client.api.Message;
//import org.apache.pulsar.client.api.MessageListener;
//import org.springframework.stereotype.Service;
//
///**
// * @author wangnaiqi
// * @description TODO
// * @date 2023/12/13
// */
//@Service
//public class ConsumerService implements MessageListener<String> {
//
//    @Override
//    public void received(Consumer<String> consumer, Message<String> msg) {
//        // 在这里实现你的业务逻辑
//        System.out.println("消费者1 我在消费: " + new String(msg.getData()));
//        try {
//            consumer.acknowledge(msg);
//        } catch (Exception e) {
//            consumer.negativeAcknowledge(msg);
//        }
//    }
//
//}
